import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/*
 * unit test function
 */
public class numTest {
	boardInfor temp;
    aListInfor temp3;
    cardInfor temp2;
    attachmentInfor temp4;
    
	@Before
	public void setUp() throws Exception {
		
		temp = new boardInfor();
        temp3 = new aListInfor();
        temp2 = new cardInfor();
        temp4 = new attachmentInfor();
        
        temp.createNewBoard("A",11,1);
        temp.createNewBoard("B",12,2);
        temp.createNewBoard("C",13,3);
        temp.attachLists(temp3, 2);
        
        
        temp3.createNewList("List01",1);
        temp3.createNewList("List02",2);
        temp3.createNewList("List03",3);
        temp3.attachCardList(temp2, "List03");
        
        


        temp2.createNewCard("Card01",123,111);        
        temp2.createNewCard("Card02",345,111);
        temp2.createNewCard("Card03",577,111);

        temp2.attachAttachmentList(temp4, "Card01");
        
        temp4.upload("jj.jpg");
        temp4.upload("gg.jpg");
        temp4.upload("aa.jpg");
        temp4.upload("kk.jpg");
        temp4.upload("ll.jpg");
        
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testBoardHaveListNum() {
		
		int BoardBhaveLists = temp.getNumOfListOnTheBoard(2);
		int answer = 3;
		assertEquals(BoardBhaveLists,answer);  

	}
	@Test
	public void testListHaveCardNum() {
		
		int List03haveCard = temp3.getNumOfCardOnTheList("List03");
		int answer = 3; 
		assertEquals(List03haveCard,answer);  

		
	}
	@Test
	public void testCardHaveAttachmentNum() {
		
		
		int Card01haveAttachments = temp2.getNumOfAttachmentOnTheCard("Card01");
		int answer = 5;
		assertEquals(Card01haveAttachments,answer);  
		  
		
		
		
	}

}
